// CommonJS 方式引入 Axios
apiUrl = 'https://api.52vmy.cn/api/wl/yan/yiyan'
const axios = require('axios')

// 使用 async/await 关键字进行改进
const getData = async (apiUrl) => {
    try {
        const response = await axios.get(apiUrl)
        console.log("response:", response.data)
        if (response.data.code === 200) {
            const response = await axios.get(apiUrl)
            console.log("response:", response.data)
            if (response.data.code === 200) {
                const response = await axios.get(apiUrl)
                console.log("3.response.data:", response.data)
                if (response.data.code != 200) {
                    console.log("3.response.data.code!=200,msg:", response.data.msg)
                }
            } else {
                console.log("2.response.data.code!=200,msg:", response.data.msg)
            }
        } else {
            console.log("1.response.data.code!=200,msg:", response.data.msg)
        }
    } catch (error) {
        console.log("error:", error)
    } finally {
        console.log("finally")
    }
}

getData(apiUrl)